package io.gitee.cengxiaoxiao.converters;

import java.util.HashMap;
import java.util.Map;

public class GenderDictConverter extends AbstractDictConverter {

    @Override
    public Object codeToText(Object code) {
        Map<String, Object> genderMap = new HashMap<>();
        genderMap.put("M", "男");
        genderMap.put("F", "女");
        return genderMap.get((String) code);
    }

    @Override
    public Object textToCode(Object text) {
        Map<String, Object> genderMap = new HashMap<>();
        genderMap.put("男", "M");
        genderMap.put("女", "F");
        return genderMap.get((String) text);
    }
}
